package com.handu.luna.core.domain.order;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Transient;

import com.handu.luna.core.domain.BasePersistentDomain;
import com.handu.luna.core.domain.user.User;

@Entity
public class ReturnsOrder extends BasePersistentDomain<ReturnsOrderRepository>{
	
	public enum ApplicationStatus{
		UNTREATED("未处理"),AGREE("同意"),REFUSE("拒绝");
		public String description;
		ApplicationStatus(final String description){
			this.description = description;
		}
	}
	
	public enum ReturnsType{
		REFUNDANDRETURNS("退款退货"),REFUNDS("仅退款");
		public String description;
		ReturnsType(final String description){
			this.description = description;
		}
	}
	
	
	private String orderNumber;
	
	@Transient
	private OrderInfo order;
	
	private long userId;
	
	@Transient
	private User user;
	
	private String returnReason;
	
	private Date applicationTime;
	
	private ApplicationStatus applicationStatus;
	
	private ReturnsType returnsType;

	public String getOrderNumber() {
		return orderNumber;
	}

	public void setOrderNumber(String orderNumber) {
		this.orderNumber = orderNumber;
	}

	public OrderInfo getOrder() {
		return order;
	}

	public void setOrder(OrderInfo order) {
		this.order = order;
	}

	public long getUserId() {
		return userId;
	}

	public void setUsername(long userId) {
		this.userId = userId;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getReturnReason() {
		return returnReason;
	}

	public void setReturnReason(String returnReason) {
		this.returnReason = returnReason;
	}

	public Date getApplicationTime() {
		return applicationTime;
	}

	public void setApplicationTime(Date applicationTime) {
		this.applicationTime = applicationTime;
	}

	public ApplicationStatus getApplicationStatus() {
		return applicationStatus;
	}

	public void setApplicationStatus(ApplicationStatus applicationStatus) {
		this.applicationStatus = applicationStatus;
	}

	public ReturnsType getReturnsType() {
		return returnsType;
	}

	public void setReturnsType(ReturnsType returnsType) {
		this.returnsType = returnsType;
	}

	public ReturnsOrder(String orderNumber, long userId, String returnReason,
			Date applicationTime, ApplicationStatus applicationStatus,
			ReturnsType returnsType) {
		super();
		this.orderNumber = orderNumber;
		this.userId = userId;
		this.returnReason = returnReason;
		this.applicationTime = applicationTime;
		this.applicationStatus = applicationStatus;
		this.returnsType = returnsType;
	}

	public ReturnsOrder() {
		super();
	}
	
}
